export function  findComponent(parent,name) {
    if(parent.$children && parent.$children.length>0){
      var item = parent.$children.find(item=>{
        
        return  item.$attrs.name == name; 
      })
      if(item){
        
        return item
      }else{
        for(var index in parent.$children){
          var res = findComponent( parent.$children[index],name);
          if(res){
            
            return res;
          }
        }
      }
    }else{
      return undefined
    }
}